const koaBody = require("koa-body")
const router = require("../router")
const render = require('koa-art-template');
const static = require("koa-static")
const path = require("path")

function init(app){
    app.use(koaBody())
    app.use(router.routes())
    app.use(static(path.join(process.cwd(),"static")))
    render(app, {
        root: path.join(process.cwd(), 'pages'),
        extname: '.html',
        debug: process.env.NODE_ENV !== 'production'
    });
}
module.exports = init